<%@ taglib prefix="c"   uri="http://java.sun.com/jsp/jstl/core" %>
<%@page import = "com.db4o.ext.ExtObjectContainer" %>
<%@page import = "com.db4o.servlet.Db4oServlet" %>
<%@page import = "facades.*" %>
<%@page import = "auser.*" %>
<%@page import = "com.db4o.query.*" %>

<% session.removeAttribute("editPdoppia"); %>
<% SessionFacade sfacade = new SessionFacade(session); %>
<% request.setAttribute("sfacade",sfacade); %>
<% String id = request.getParameter("id"); %> 
  
<c:if test="${!empty param.id}">
	<%  Object pdoppia = sfacade.getById(id); %>
	<%  session.setAttribute("editPdoppia",pdoppia); %>
	<c:set var="editLock" value="disabled" scope="request" />
	<c:set var="displayCausali" value="none"  scope="request"/> 
	<c:set var="startingCausale" value="${editPdoppia.causale}"  scope="request"/>
</c:if>

<c:if test="${empty param.id}">
	<%  session.setAttribute("editPdoppia",new ScritturaDiPrimaNota()); %>
	<jsp:setProperty name="editPdoppia" property="*" />
	<jsp:setProperty name="editPdoppia" property="circolo" value="${userBean.circolo}" />
	<c:set var="editLock" value="" scope="request" />
	<c:set var="displayCausali" value="block"  scope="request"/>
	<c:set var="startingCausale" value="economico_costi"  scope="request"/>
	
</c:if>
<jsp:forward page="edit.jsp" />